home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
misc
/
emu
/
prlink_amiga.lha
/
prlink-0.8.0a
/
src
/
petscii.c
< prev
next >
Wrap
Text File
|
1995-04-03
|
624b
|
33 lines
/*
* only deal with letters in upper/lowercase character set.
* a-z = 0x41 - 0x5A
* A-Z = 0xC1 - 0xDA
* Punctuation 0x20 - 0x3F and 0x5B - 0x5F is virtually identical.
*/
void
ascii2petscii(unsigned char *p)
{
while (p[0]) {
if (p[0] >= 'A' && p[0] <= 'Z') {
p[0] += -'A' + 0x41 + 0x80;
} else if (p[0] >= 'a' && p[0] <= 'z') {
p[0] += -'a' + 0x41;
}
p++;
}
}
void
petscii2ascii(unsigned char *p)
{
while (p[0]) {
if (p[0] >= 0xC1 && p[0] <= 0xDA) {
p[0] -= -'A' + 0x41 + 0x80;
} else if (p[0] >= 0x41 && p[0] <= 0x5A) {
p[0] -= -'a' + 0x41;
}
p++;
}
}